package com.devilvan.betrice.event;

import com.devilvan.betrice.sensitive.dto.SysSensitiveLogDto;
import com.devilvan.betrice.sensitive.service.SysSensitiveLogService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

/**
 * @author Evad.Wu
 * @Description 敏感信息日志 事件监听类
 * @date 2023-08-14
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class SysSensitiveLogEventListener {
    private final SysSensitiveLogService sysSensitiveLogService;

    @Async
    @EventListener
    public void recordLoginOperLog(SysSensitiveLogDto sysSensitiveLogDto) {
        sysSensitiveLogService.saveUpdate(sysSensitiveLogDto);
    }
}
